<?php
	class Json extends Base {
		
		public static function toJson($obj) {
			if( $obj instanceof BaseModel ) {
				$arr = array( self::lcfirst(get_class($obj)) => $obj->json() );	
			} else {
				$arr = array("list" => $obj);	
			}
			return json_encode($arr);			
		}	
		
	}
?>